import java.awt.Image;
import java.util.ArrayList;
import java.util.Stack;

import javax.swing.JLabel;

public class Human {

	int humanNumber;
	static Stack<Node> pathList = new Stack<Node>();
	static int speed;
	int startNode;
	int currentNode =0;
	ArrayList xList = new ArrayList();
	ArrayList yList = new ArrayList();
	int pathNodeCount = 0;
	Image humanImage;
	
	public static Stack<Node> getPath(int strtNode, ArrayList<Integer> goalList) {
		Path path = new Path();
		// Stack<Node> pathList = new Stack<Node>();
		Util util = new Util();
		ArrayList listSize = new ArrayList();
		for (int i = 0; i < goalList.size(); i++) {
			Stack<Node> AStarList = new Stack<Node>();
			AStarList.addAll(pathList = path.AStarSearch(strtNode, goalList
					.get(i)));
			listSize.add(AStarList);

		}

		int index = util.stackSort(listSize);

		Stack<Node> finalNodes = new Stack<Node>();
		finalNodes = (Stack<Node>) listSize.get(index);

		pathList = finalNodes;

		return pathList;
	}

	public static int getStartLocations(int columns, int rows,
			ArrayList<JLabel> labelList) {
		Util util = new Util();
		int start = 0;
		int totalLocations = (columns * rows) - 1;
		start = util.showRandomInteger(0, totalLocations);
		return start;
	}

	/**
	 * @return the humanNumber
	 */
	public int getHumanNumber() {
		return humanNumber;
	}

	/**
	 * @param humanNumber
	 *            the humanNumber to set
	 */
	public void setHumanNumber(int humanNumber) {
		this.humanNumber = humanNumber;
	}
	
	public static int humanTravelSpeed() {

		Util util = new Util();
		int humanSpeed = 1;
		humanSpeed = util.showRandomInteger(1, 3);
		speed = humanSpeed;
		return humanSpeed;
	}

	public int getStartNode() {
		return startNode;
	}

	public void setStartNode(int startNode) {
		this.startNode = startNode;
	}
	
	public int getCurrentNode() {
		return currentNode;
	}

	public void setCurrentNode(int currentNode) {
		this.currentNode = currentNode;
	}

	public int getPathNodeCount() {
		return pathNodeCount;
	}

	public void setPathNodeCount(int pathNodeCount) {
		this.pathNodeCount = pathNodeCount;
	}

	/**
	 * @return the humanImage
	 */
	public Image getHumanImage() {
		return humanImage;
	}

	/**
	 * @param humanImage the humanImage to set
	 */
	public void setHumanImage(Image humanImage) {
		this.humanImage = humanImage;
	}
}
